<?php

	foreach($_REQUEST AS $clave => $valor){
		//echo"<input type=\"hidden\" name=\"$clave\" value=\"$valor\">";
		$$clave = $valor;
	}
	
	$xdoc = new DomDocument;
	$xdoc->load("palabras.xml");
	if (!$xdoc) {
		echo 'Error al parsear el documento';
		exit;
	}
	
	$xml = simplexml_import_dom($xdoc);

	echo "<div style=\"padding: 30px 0px 0px 0px;\">";
	foreach ($xml->palabra as $palabra) {
		if($palabra->espanolComun == $registro){
				echo "<table id=\"tablasPalabras\">";
				echo "<tr><td colspan=\"4\">$palabra->espanolComun</td></tr>";
				echo "<tr><td colspan=\"4\">$palabra->ambitoTematico</td></tr>";
				echo "<tr><td colspan=\"4\">$palabra->categoriaGramatical"." "."$palabra->definicion</td></tr>";
				echo "<tr>";
				echo "<td>Venezuela</td><td>Colombia</td><td>Ecuador</td><td>Per&uacute;</td>";
				echo "</tr>";
				echo "<tr>";
				echo "<td>$palabra->acepcionVenezuela</td>";
				echo "<td>$palabra->acepcionColombia</td>";
				echo "<td>$palabra->acepcionEcuador</td>";
				echo "<td>$palabra->acepcionPeru</td>";
				echo "</tr>";
				echo "<tr>";
				echo "<td>$palabra->ejemploVenezuela<br><br>$palabra->fuenteVenezuela</td>";
				echo "<td>$palabra->ejemploColombia<br><br>$palabra->fuenteColombia</td>";
				echo "<td>$palabra->ejemploEcuador<br><br>$palabra->fuenteEcuador</td>";
				echo "<td>$palabra->ejemploPeru<br><br>$palabra->fuentePeru</td>";
				echo "</tr>";
				echo "</table>";
				echo "<br><br><br>";
		}
	}
	echo "</div>";
?>

